package com.oak.designmode._01_factoryPattern.easyFactory;

/**
 * 工厂类
 *
 * @ClassName: IceCreamFactory
 * @Description
 * @Author guoxy
 * @Date 2019/12/4
 * @Version 1.0
 */
public class IceCreamFactory {

    public static IceCream creamIceCream(String taste){

        IceCream iceCream = null;
        // 这里我们通过switch来判断，具体制作哪一种口味的冰激凌
        switch(taste){
            case "Apple":
                iceCream = new AppleIceCream();
                break;
            case "Orange":
                iceCream = new OrangeIceCream();
                break;
            case "Banana":
                iceCream = new BananaIceCream();
                break;
            default:
                break;
        }

        return iceCream;
    }
}